#Jmcelroy
#
import sys

class value:
		def __init__(self):
				self.val = None


class bool(value):
		def __init__(self,b):
				value.__init__(self)
				self.b = b
				self.val = 'bool'

class int(value):
		def __init__(self,i):
				value.__init__(self)
				self.i = i
				self.val = 'int'

class float(value):
		def __init__(self,f):
				value.__init__(self)
				self.f = f
				self.val = 'float'


class prime(value):
		def __init__(self, op, lef, rit):
				value.__init__(self)
				self.op = op
				self.lef = lef
				self.rit = rit
				self.val = 'prime'

class interp:
		def __init__(self,expr):
				self.expr = expr
		def run(self):
				if(self.expr.val == 'num'):		
						return self.expr.n
				elif(self.expr.val == 'prime'):
						if(self.expr.op == '+'):
								return (interp(self.expr.lef)).run() + (interp(self.expr.rit)).run()
						elif(self.expr.op == '-'):
								return (interp(self.expr.lef)).run() - (interp(self.expr.rit)).run()
				else: 
					print "ERROR!"




interpb = interp(int(6)) 
print interpb.run()

interpc = interp(prime('+',int(6),int(8))) 
print interpc.run()

interpd = interp(prime('+',prime('-',int(7),int(2)),int(8))) 
print interpd.run()
